﻿@model SiteModel

@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.Id)

<script type="text/javascript">
    $(document).ready(function () {

        $("#@Html.FieldIdFor(model => model.SslEnabled)").click(toggleSslEnabled);
        
        toggleSslEnabled();
    });

    function toggleSslEnabled() {
        if ($('#@Html.FieldIdFor(model => model.SslEnabled)').is(':checked')) {
            $('#pnlSecureUrl').show();
        }
        else {
            $('#pnlSecureUrl').hide();
        }
    }
</script>
<table class="adminContent">
    <tr>
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.Name):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.Url):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.Url)
            @Html.ValidationMessageFor(model => model.Url)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.SslEnabled):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.SslEnabled)
            @Html.ValidationMessageFor(model => model.SslEnabled)
        </td>
    </tr>
    <tr>
        <td class="adminTitle" colspan="2">
            <i>@T("Admin.Configuration.Sites.Fields.SslEnabled.Hint2")</i>
        </td>
    </tr>
    <tr id="pnlSecureUrl">
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.SecureUrl):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.SecureUrl)
            @Html.ValidationMessageFor(model => model.SecureUrl)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.Hosts):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.Hosts)
            @Html.ValidationMessageFor(model => model.Hosts)
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            @Html.CmsLabelFor(model => model.DisplayOrder):
        </td>
        <td class="adminData">
            @Html.EditorFor(model => model.DisplayOrder)
            @Html.ValidationMessageFor(model => model.DisplayOrder)
        </td>
    </tr>
</table>
